﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{

    public partial class selection : Form
    {
        miscellaneousCharges form2;
        viewPreviousReports viewReports;
        editEmployeeRecordsModule editEmployee;
        tipForm viewTip;
        logInModule parent;
        public selection(logInModule parent)
        {
            this.parent = parent;
            InitializeComponent();
            viewReports = new viewPreviousReports(this);
            editEmployee = new editEmployeeRecordsModule(this);
            viewTip = new tipForm(this);
        }

        private void viewAndAddTipButton_Click(object sender, EventArgs e)
        {
            this.Hide();
            viewTip.Show();
        }

        private void generateReportSheetButton_Click(object sender, EventArgs e)
        {

        }

        private void viewPreviousReportsButton_Click(object sender, EventArgs e)
        {
            this.Hide();
            viewReports.Show();

        }

        public Button getGenerateReportSheet()
        {
            return generateReportSheetButton;
        }

        public Button getViewPreviousReportsButton()
        {
            return viewPreviousReportsButton;
        }

        private void editEmployeeRecords_Click(object sender, EventArgs e)
        {
            this.Hide();
            editEmployee.Show();
        }

        protected override void OnFormClosing(FormClosingEventArgs e)
        {
            base.OnFormClosing(e);
            DialogResult result = MessageBox.Show("Are you sure you want to exit the program?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
            if (result == DialogResult.No)
                e.Cancel = true;
            else
                Environment.Exit(1);
        }

        private void logOut_Click(object sender, EventArgs e)
        {
            this.Hide();
            parent.Show();
        }

        private void tipChargeSetMiscellaneousCharges_Click(object sender, EventArgs e)
        {
            if (form2 == null)
            {
                form2 = new miscellaneousCharges();
            }
            form2.ShowDialog();
        }
    }
}
